package com.wsoft.system.controller;

import cn.hutool.core.convert.Convert;
import com.wsoft.dto.LogDto;
import com.wsoft.response.ResponsePage;
import com.wsoft.response.ResponseResult;
import com.wsoft.service.ISysLogService;
import com.wsoft.system.query.log.LogListQuery;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author z001
 * @since 2024年11月18日 17:45:50
 */
@RestController
@RequestMapping("/sys/log")
public class SysLogController {

    @Resource
    private ISysLogService logService;

    @Operation(summary = "获取日志列表",description = "获取日志列表")
    @PostMapping("/list")
    public ResponseResult pageList(@RequestBody LogListQuery query) {
        return ResponseResult.success(ResponsePage.restPage(logService.pageList(Convert.convert(LogDto.class,query))));
    }

}
